Add a thin shim around QDateTime to make it more compatible with our C-inspired
authorrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 12 Aug 2011 04:02:29 +0000 (04:02 +0000)
committerrobertlipe@gmail.com <robertlipe@gmail.com@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 12 Aug 2011 04:02:29 +0000 (04:02 +0000)
usage for creation_time.

git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4081 f51c46e8-681c-474f-0cfe-069cfd0219fb

gpsbabel/gbdatetime.h [new file with mode: 0644]

diff --git a/gpsbabel/gbdatetime.h b/gpsbabel/gbdatetime.h
new file mode 100644 (file)
index 0000000..6b56171
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright ME.   
+
+#include <QDateTime>
+
+// As this code began in C, we have several hundred places that set and
+// read creation_time as a time_t.  Provide some operator overloads to make
+// that less painful.
+class gbDateTime : public QDateTime {
+public:
+  operator const time_t() const {
+    return this->toTime_t();
+  }
+  const time_t& operator=(const time_t& t) {
+    this->setTime_t(t);
+  }
+};
+
+